/*
 * Class Brain.java
 * 9.06.2012
 * 
 * Class represents brain organ.
 */

package human;

/**
 * Class implements a model of human brain. It has a number of characteristics
 * (such as fatigue and oxygen level) which changes according human activities.
 * Brain could be cause of death because it's vital organ.
 * 
 * @author Vasyl Khyzhniak
 * @version 1.2
 */
public class Brain extends Organ {
	private int fatigue; // how much it tired
	private int oxygenation; // oxygen level
	private int memory; // ability to remember

	/**
	 * Brain Class Constructor Sets all live characteristics to newborn level
	 * which * is equal to zero. Also defines brain as necessary for life organ
	 * (isNecessaryForLife = true)
	 */
	public Brain() {
		health = 0;
		fatigue = 0;
		memory = 0;
		oxygenation = 0;
		isNecessaryForLife = true;
                name="Brain";
                parametrs.addParameter(new Parameter("oxygenation", 100));
                parametrs.addParameter(new Parameter("health", 100));
                parametrs.addParameter(new Parameter("fatigue", 100));
                parametrs.addParameter(new Parameter("memory", 100));
	}

	/**
	 * Changes brain fatigue on value
	 * 
	 * @param value
	 *            Defines the change of brain fatigue
	 */
	public void changeFatigue(int value) {
		fatigue = checkLimits(fatigue, value);
	}

	/**
	 * Changes level of oxygenation on value
	 * 
	 * @param value
	 *            Defines the change of oxygenation
	 */
	public void changeOxygenation(int value) {
		oxygenation = checkLimits(oxygenation, value);
	}

	/**
	 * Changes brain opportunity to remember information on value.
	 * 
	 * @param value
	 *            Defines the change of opportunity to remember
	 */
	public void changeMemory(int value) {
		memory = checkLimits(memory, value);
	}

	public int getFatigue() {
		return fatigue;
	}

	public int getOxygenation() {
		return oxygenation;
	}

	public int getMemory() {
		return memory;
	}
}
